package com.bindapp.util;

import android.os.CountDownTimer;

import com.bindapp.listener.TimeCountListener;

/**
 * Created by apple on 2018/6/27.
 */

public class TimeCount extends CountDownTimer {
    private TimeCountListener listener;

    public TimeCount(long millisInFuture, long countDownInterval,TimeCountListener listener) {
        super(millisInFuture, countDownInterval);//参数依次为总时长,和计时的时间间隔
        this.listener=listener;
    }

    @Override
    public void onFinish() {
        listener.onFinish();
    }

    @Override
    public void onTick(long millisUntilFinished) {
        listener.onTick(millisUntilFinished);
    }

}
